/**
 * Created by DevilsEyes on 2016/5/15.
 */
'use strict';
var Vue = require('../../lib/vue.common.min.js');

var vm = null;

function init() {
    vm = new Vue({
        el: '#message',
        data: {
            show: false,
            content: ''
        }
    });
}

module.exports = {
    init: init,
    open: (content, time = 2000)=> {
        if (vm == null)return;
        vm.content = content;
        if (vm.show == false) {
            vm.show = true;
            setTimeout(()=> {
                vm.show = false
            }, time)
        }
    }
};